<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>变量</title>
</head>
<body>
    <script>
        //创建变量
        let num;
        num=10;
        console.log(num);
        let NUM;
        NUM=1000;
        console.log(NUM);
        let str;
        console.log(str);//未定义
        //常量：定义之后不能修改
        const userName = 'admin';
        console.log(userName);
        //userName = 'xiaomi';不可以重新给常量赋值，执行代码会报错
        console.log(userName)
    </script>
</body>
</html>